
<%@page import="java.util.HashMap"%>
<%@page import="dto.RoomDTO" %>
<%@page import="util.Utilities"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>후기 리스트</title>

</head>
<body>
<%HashMap map = (HashMap)request.getAttribute("map"); %>
<%RoomDTO rdto = (RoomDTO)map.get("room");%>

<%-- ${entry.value.list } --%>

<c:forEach items="${requestScope.map }" var="entry">
	<c:if test="${entry.key=='ldto'}">
		
<c:choose>
	<c:when test="${entry.value.pagingDTO.previousPageGroup }">
	<a href="getContentByRoom.do?page=${entry.value.pagingDTO.startPageOfPageGroup -1 }&postScript_roomno=<%=rdto.getRoomNo() %>">
				◀
				</a>
	</c:when>
	<c:otherwise>
				◀
	</c:otherwise>
	</c:choose>
	<c:forEach begin="${entry.value.pagingDTO.startPageOfPageGroup }"
							   end="${entry.value.pagingDTO.endPageOfPageGroup }"
							   step="1"
							   var ="i">
			<c:choose>
				<c:when test="${i == entry.value.pagingDTO.currentPage }">
					${i }
				</c:when>
				<c:otherwise>
					<a href="getContentByRoom.do?page=${i }&postScript_roomno=<%=rdto.getRoomNo() %>">${i }</a>
				</c:otherwise>
			</c:choose>			
		</c:forEach>
		<c:choose>
			<c:when test="${entry.value.pagingDTO.nextPageGroup }">
				<a href="getContentByRoom.do?page=${entry.value.pagingDTO.endPageOfPageGroup + 1 }&postScript_roomno=<%=rdto.getRoomNo() %>">
				▶
				</a>
			</c:when>
			<c:otherwise>
				▶
			</c:otherwise>
		</c:choose>
	</c:if>
	<c:if test="${entry.key=='ldto'}">
		<c:forEach items="${entry.value.list }" var="entry">
		<table border="1">
<tr>
<td width="100"><img src="/${initParam.context_root }/member_picture/${entry.picture_filename}" width="100" ></td>
<td rowspan="4" width="700">${entry.postScript_content }</td>
</tr>
<tr>
<td align="center">${entry.postScript_memberid}</td>
</tr>
<tr>
<td align="center">${entry.postScript_writedate}</td>
</tr>
<tr>
<td>
<c:choose>
	<c:when test="${entry.postScript_score == 1}">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">	
	</c:when>
	<c:when test="${entry.postScript_score == 2}">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">	
	</c:when>
	<c:when test="${entry.postScript_score == 3}">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/whitestar.png">
		<img src="/${initParam.context_root }/img/whitestar.png">	
	</c:when>
	<c:when test="${entry.postScript_score == 4}">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/whitestar.png">	
	</c:when>
	<c:when test="${entry.postScript_score == 5}">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">
		<img src="/${initParam.context_root }/img/goldstar.jpg">	
	</c:when>
</c:choose>
</td>
</tr>
</table>
<c:choose>
	<c:when test='${sessionScope.login_info.member_id != entry.postScript_memberid}'>
	  
	</c:when>
	
	<c:otherwise> 	
 		<a href="/${initParam.context_root }/delete.do?no=${entry.postScript_no}">글삭제하기</a><br>
		<a href="/${initParam.context_root }/modifyForm.do?no=${entry.postScript_no}">수정하기</a><br>
 	</c:otherwise>
 </c:choose>
</c:forEach>
	</c:if>
</c:forEach>


</body>
</html>	
